Show All

DisplayIn Property

       

Returns or sets a PivotMemberPropertyDisplayEnum constant that determines whether the specified member property is displayed in the PivotTable list, ScreenTip, both the PivotTable list and ScreenTip, or not at all. Read/write.

expression.DisplayIn

expression   Required. An expression that returns a PivotMemberProperty object.

Example

This example sets the captions of, and then displays the member captions of the Store Name field.

Sub Display_MemberProperties()
    Dim ptView
    Dim ptConstants
    Dim fldStoreName

    Set ptConstants = PivotTable1.Constants

    ' Set a variable to the active view of the PivotTable.
    Set ptView = PivotTable1.ActiveView

    ' Set a variable to the Store Name field.
    Set fldStoreName = ptView.FieldSets("Store").Fields("Store Name")

    ' The following three lines of code specify that the member properties are
    ' displayed in the PivotTable list.
    fldStoreName.MemberProperties("Store Manager").DisplayIn = ptConstants.plDisplayPropertyInReport
    fldStoreName.MemberProperties("Store Type").DisplayIn = ptConstants.plDisplayPropertyInReport
    fldStoreName.MemberProperties("Store Sqft").DisplayIn = ptConstants.plDisplayPropertyInReport

    ' The following three lines of code set the caption for the member properties.
    fldStoreName.MemberProperties("Store Manager").Caption = "Manager Name"
    fldStoreName.MemberProperties("Store Type").Caption = "Store Type"
    fldStoreName.MemberProperties("Store Sqft").Caption = "Size in SQFT"
End Sub